package org.example.service.impl;

import org.example.dao.UserDao;
import org.example.dao.impl.UserDaoImpl;
import org.example.entity.User;
import org.example.service.UserService;

public class UserServiceImpl implements UserService {
    UserDao userDao = new UserDaoImpl();

    @Override
    public boolean login(String name, String password){
        User user = userDao.getUserName(name);
        if(user != null){
            if(password.equals(user.getUserPassword())){
                System.out.println("登录成功");
                return true;
            }
        }
        System.out.println("登录失败");
        return false;
    }
}